<script setup lang="ts">
import { ref } from 'vue'
import { eventBus } from '@/utils/eventBus'

const message = ref('Hello from Component A')

// 发送事件
const sendMessage = () => {
  eventBus.emit('messageSent', message.value)
}
</script>

<template>
  <button @click="sendMessage">Send Message</button>
</template>
